﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    
    <script src="~/layui/layui.js"></script>
    @*<script src="~/lib/microsoft/signalr/dist/browser/signalr.js"></script>*@
    <style type="text/css">
        .layui-icon {
            font-size: 20px;
            vertical-align: middle;
        }

        .kit-side-fold {
            text-align: center;
        }
        .layui-nav-third-child {
            display: none;
            position: absolute;
            left: 105px;
            top: 25px;
            min-width: 100%;
            line-height: 36px;
            padding: 5px 0;
            box-shadow: 0 2px 4px rgba(0,0,0,.12);
            border: 1px solid #d2d2d2;
            background-color: #fff;
            z-index: 100;
            border-radius: 2px;
            white-space: nowrap;
        }

        .layui-nav .layui-nav-third-child a {
            color: black;
            
        }

            .layui-nav .layui-nav-third-child a:hover {
                background-color: deepskyblue;
                color: white;
            }

        .layui-nav-third-child li {
            position: relative;
        }

        .layui-nav-third-child li {
            background-color: transparent;
            color: white;
        }

        .layui-nav .layui-nav-third-child li.layui-this a {
            background-color: transparent;
            color: white;
        }

        .layui-nav-third-child li:after {
            display: none;
        }

     
    </style>
    @RenderSection("Style", required: false)
</head>
<body  style="overflow: scroll;overflow-x:hidden">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo" style="font-size: 20px;">数据分析系统V2.0</div>
            <!-- 头部区域（可配合layui已有的水平导航） -->
            <ul class="layui-nav layui-layout-left">
               
               
                <li class="layui-nav-item">
                    <a href="">数据监控</a>
                    <dl class="layui-nav-child" id="vehiclemonitor">
                     
                    </dl>
                </li>

              @*   <li class="layui-nav-item">
                    <a href="">数据预测</a>
                    <dl class="layui-nav-child" id="dataprediction">
                      
                    </dl>
                </li> *@
                <li class="layui-nav-item">
                    <a href="">PUMA分析</a>
                    <dl class="layui-nav-child" id="mileageanalysis">
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="">正常分析</a>
                    <dl class="layui-nav-child" id="dataanalysis">
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="" >PUMA导入</a>
                    <dl class="layui-nav-child" id="mileageimport">
                    </dl>
                </li>
                <li class="layui-nav-item" >
                    <a href="" id="dataimporta">正常导入</a>
                    <dl class="layui-nav-child" id="dataimport">

                    </dl>
                </li>
                <li class="layui-nav-item" >
                    <a href="" id="datadeletea">数据删除</a>
                    <dl class="layui-nav-child" id="datadelete">
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="">设置</a>
                    <dl class="layui-nav-child" id="vehiclesetup">
                        <dd><a href="@Url.Action("GPSTrackAll", "Home")">地图轨迹</a></dd>
                        <dd><a href="@Url.Action("T_VehicleMaster", "Home")">车辆参数主表</a></dd>
                        <dd><a href="@Url.Action("T_VehicleMonitorPara", "Home")">车辆参数副表-监控</a></dd>
                        <dd><a href="@Url.Action("T_VehicleImportPara", "Home")">车辆参数副表-数据导入</a></dd>
                        <dd><a href="@Url.Action("T_VehicleComputePara", "Home")">车辆参数副表-数据分析</a></dd>
                        <dd><a href="@Url.Action("Chat", "Home")">聊天室测试</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img id="id" src="#" class="layui-nav-img">
                        <span id="user"> </span>
                    </a>

                </li>
                <li class="layui-nav-item"><a href="@Url.Action("Logout", "Login")">退出</a></li>
            </ul>
        </div>
    </div>



    @RenderBody()
  
<script>


    var element = document.getElementById('id');
    var span = document.getElementById('user');
    var hideorshow = document.getElementById('dataimporta');
    var hideorshowfordelete = document.getElementById('datadeletea');
        if ("@ViewBag.User"=="Admin") {
            element.src ="/Pictures/Boss.png"
            span.textContent = "Admin";
            hideorshow.style.display="block";
            hideorshowfordelete.style.display="block";
        }
        else {
            element.src = "/Pictures/User.png";
            span.textContent = "User";
            hideorshow.style.display = "none";
            hideorshowfordelete.style.display = "none";
    }


    layui.use(['element'], function () {
        var $ = layui.jquery;
        
        $.ajax({
            //获取数据库里的车辆
            url: '@Url.Action("GetVehicleStateID", "Home")',
            dataType: 'json',
            type: 'post',
            success: function (data) {
                    if (data.length > 0) {
                        var vehicledl1 = document.getElementById("vehiclemonitor");
                        var vehicledl2 = document.getElementById("dataimport");
                        var vehicledl3 = document.getElementById("dataanalysis");
                        // var vehicledl4 = document.getElementById("dataprediction");
                        var vehicledl5 = document.getElementById("datadelete");

                        var vehicledl6 = document.getElementById("mileageanalysis");
                        var vehicledl7 = document.getElementById("mileageimport");
                        for (var i = 0; i < data.length; i++) {
                            var item = data[i];
                            var dd1 = document.createElement("dd");
                            var dd2 = document.createElement("dd");
                            var dd3 = document.createElement("dd");
                            var dd4 = document.createElement("dd");
                            var dd5 = document.createElement("dd");
                            var dd6 = document.createElement("dd");
                            var dd7 = document.createElement("dd");

                            a1 = document.createElement('a');
                            a2 = document.createElement('a');

                            a3 = document.createElement('a');
                            a4 = document.createElement('a');
                            a5 = document.createElement('a');
                            a6 = document.createElement('a');
                            a7 = document.createElement('a');
                            a1.href = "/Html/WatchHtml/index.html?id=" + item;

                            a1.target = '_blank';
                            a1.target = "/Html/WatchHtml/index.html?id=" + item;

                            a2.href = "/Html/ImportHtml/ImportData.html?id=" + item;
                            a2.target = "/Html/ImportHtml/ImportData.html?id=" + item;

                            a3.href = "/Html/AnalysisHtml/Analysis.html?id=" + item;
                            a3.target = "/Html/AnalysisHtml/Analysis.html?id=" + item;

                            a4.href = "/Html/PredictionHtml/Prediction.html?id=" + item;
                            a4.target = "/Html/PredictionHtml/Prediction.html?id=" + item;

                            a5.href = "/Html/DeleteHtml/DeleteData.html?id=" + item;
                            a5.target = "/Html/DeleteHtml/DeleteData.html?iid=" + item;

                            a6.href = "/Html/AnalysisHtml/MileageAnalysis.html?id=" + item;
                            a6.target = "/Html/AnalysisHtml/MileageAnalysis.html?iid=" + item;
                            a7.href = "/Html/ImportHtml/MileageImportData.html?id=" + item;
                            a7.target = "/Html/ImportHtml/MileageImportData.html?id=" + item;

                            a1.innerText = item;
                            a2.innerText = item;
                            a3.innerText = item;
                            a4.innerText = item;
                            a5.innerText = item;
                            a6.innerText = item;
                            a7.innerText = item;
                            dd1.appendChild(a1);
                            dd2.appendChild(a2);
                            dd3.appendChild(a3);
                            dd4.appendChild(a4);
                            dd5.appendChild(a5);
                            dd6.appendChild(a6);
                            dd7.appendChild(a7);
                            vehicledl1.appendChild(dd1);
                            vehicledl2.appendChild(dd2);
                            vehicledl3.appendChild(dd3);
                            // vehicledl4.appendChild(dd4);
                            vehicledl5.appendChild(dd5);
                            vehicledl6.appendChild(dd6);
                            vehicledl7.appendChild(dd7);
                        }



                    }
                    //重新渲染 固定写法
            }
        });

        
    });

</script>
    @RenderSection("Scripts", required: false)
</body>
</html>
